﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_SF_TUOSHOUMX实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_SF_TUOSHOUMX
    {
        private double? m_db_n_jine;

        private decimal? m_dec_i_feiyongbh;

        private decimal? m_dec_i_hezhangbh;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_m;

        private decimal? m_dec_i_print;

        private decimal? m_dec_i_tichubz;

        private decimal? m_dec_i_tuoshoulx;

        private decimal? m_dec_i_tuoshoupzh;

        private decimal? m_dec_i_y;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuosj;

        private string m_str_s_beiyong1;

        private string m_str_s_beiyong2;

        private string m_str_s_caozuor;

        private string m_str_s_guanlikbh;

        private string m_str_s_kaihuhm;

        private string m_str_s_kaihuyh;

        private string m_str_s_kaihuzh;

        private string m_str_s_yonghuh;

        private string m_str_s_yonghum;

        private string m_str_s_zhandianbh;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     托收凭证号
        /// </summary>
        public decimal? I_TUOSHOUPZH
        {
            get { return m_dec_i_tuoshoupzh; }
            set { m_dec_i_tuoshoupzh = value; }
        }

        /// <summary>
        ///     托收编号,核账编号,(取自收费编号)
        /// </summary>
        public decimal? I_HEZHANGBH
        {
            get { return m_dec_i_hezhangbh; }
            set { m_dec_i_hezhangbh = value; }
        }

        /// <summary>
        ///     站点
        /// </summary>
        public string S_ZHANDIANBH
        {
            get { return m_str_s_zhandianbh; }
            set { m_str_s_zhandianbh = value; }
        }

        /// <summary>
        ///     费用编号
        /// </summary>
        public decimal? I_FEIYONGBH
        {
            get { return m_dec_i_feiyongbh; }
            set { m_dec_i_feiyongbh = value; }
        }

        /// <summary>
        ///     管理块编号
        /// </summary>
        public string S_GUANLIKBH
        {
            get { return m_str_s_guanlikbh; }
            set { m_str_s_guanlikbh = value; }
        }

        /// <summary>
        ///     年
        /// </summary>
        public decimal? I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     月
        /// </summary>
        public decimal? I_M
        {
            get { return m_dec_i_m; }
            set { m_dec_i_m = value; }
        }

        /// <summary>
        ///     用户名
        /// </summary>
        public string S_YONGHUM
        {
            get { return m_str_s_yonghum; }
            set { m_str_s_yonghum = value; }
        }

        /// <summary>
        ///     金额
        /// </summary>
        public double? N_JINE
        {
            get { return m_db_n_jine; }
            set { m_db_n_jine = value; }
        }

        /// <summary>
        ///     开户名
        /// </summary>
        public string S_KAIHUHM
        {
            get { return m_str_s_kaihuhm; }
            set { m_str_s_kaihuhm = value; }
        }

        /// <summary>
        ///     开户账号
        /// </summary>
        public string S_KAIHUZH
        {
            get { return m_str_s_kaihuzh; }
            set { m_str_s_kaihuzh = value; }
        }

        /// <summary>
        ///     开户银行
        /// </summary>
        public string S_KAIHUYH
        {
            get { return m_str_s_kaihuyh; }
            set { m_str_s_kaihuyh = value; }
        }

        /// <summary>
        ///     托收类型
        /// </summary>
        public decimal? I_TUOSHOULX
        {
            get { return m_dec_i_tuoshoulx; }
            set { m_dec_i_tuoshoulx = value; }
        }

        /// <summary>
        ///     剔除标志
        /// </summary>
        public decimal? I_TICHUBZ
        {
            get { return m_dec_i_tichubz; }
            set { m_dec_i_tichubz = value; }
        }

        /// <summary>
        ///     打印标志???
        /// </summary>
        public decimal? I_PRINT
        {
            get { return m_dec_i_print; }
            set { m_dec_i_print = value; }
        }

        /// <summary>
        ///     0:正常 -1:删除
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BEIYONG1
        {
            get { return m_str_s_beiyong1; }
            set { m_str_s_beiyong1 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BEIYONG2
        {
            get { return m_str_s_beiyong2; }
            set { m_str_s_beiyong2 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_CAOZUOSJ
        {
            get { return m_DT_d_caozuosj; }
            set { m_DT_d_caozuosj = value; }
        }

        /// <summary>
        ///     用户号
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_SF_TUOSHOUMXProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_SF_TUOSHOUMXProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_SF_TUOSHOUMX实体添加或者修改YS_SF_TUOSHOUMX信息
        /// </summary>
        public bool InsertOrUpdate(YS_SF_TUOSHOUMX YS_SF_TUOSHOUMX, OracleTransaction Transaction)
        {
            if (YS_SF_TUOSHOUMX.ID == 0)
                InsertYS_SF_TUOSHOUMX(YS_SF_TUOSHOUMX, Transaction);
            else
                UpdateYS_SF_TUOSHOUMX(YS_SF_TUOSHOUMX, Transaction);
            return YS_SF_TUOSHOUMX.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_SF_TUOSHOUMX实体添加或修改YS_SF_TUOSHOUMX信息
        /// </summary>
        public bool InsertOrUpdate(YS_SF_TUOSHOUMX YS_SF_TUOSHOUMX)
        {
            return InsertOrUpdate(YS_SF_TUOSHOUMX, null);
        }


        /// <summary>
        ///     根据YS_SF_TUOSHOUMX主键删除YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_SF_TUOSHOUMX(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_SF_TUOSHOUMX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_SF_TUOSHOUMX主键删除YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_SF_TUOSHOUMX(decimal ID)
        {
            return DeleteYS_SF_TUOSHOUMX(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_SF_TUOSHOUMXesDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_SF_TUOSHOUMXesDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_SF_TUOSHOUMXesDynamic(string WhereClause)
        {
            return DeleteYS_SF_TUOSHOUMXesDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_SF_TUOSHOUMX主键选择YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_SF_TUOSHOUMX信息</returns>
        public YS_SF_TUOSHOUMX SelectYS_SF_TUOSHOUMX(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_SF_TUOSHOUMX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_SF_TUOSHOUMX = PopulateYS_SF_TUOSHOUMX(rd);
                rd.Close();
                return YS_SF_TUOSHOUMX;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_SF_TUOSHOUMX主键选择YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <returns>YS_SF_TUOSHOUMX信息</returns>
        public YS_SF_TUOSHOUMX SelectYS_SF_TUOSHOUMX(decimal ID)
        {
            return SelectYS_SF_TUOSHOUMX(ID, null);
        }

        /// <summary>
        ///     选择所有YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_SF_TUOSHOUMX信息</returns>
        public DataTable SelectYS_SF_TUOSHOUMXesAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_SF_TUOSHOUMXesAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <returns>所有YS_SF_TUOSHOUMX信息</returns>
        public DataTable SelectYS_SF_TUOSHOUMXesAll()
        {
            return SelectYS_SF_TUOSHOUMXesAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_SF_TUOSHOUMX信息</returns>
        public DataTable SelectYS_SF_TUOSHOUMXesDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_SF_TUOSHOUMXesDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_SF_TUOSHOUMX信息</returns>
        public DataTable SelectYS_SF_TUOSHOUMXesDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_SF_TUOSHOUMXesDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_SF_TUOSHOUMX信息</returns>
        public DataTable SelectYS_SF_TUOSHOUMXesDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_SF_TUOSHOUMXesDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_SF_TUOSHOUMX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_SF_TUOSHOUMX信息</returns>
        public DataTable SelectYS_SF_TUOSHOUMXesDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_SF_TUOSHOUMXesDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_SF_TUOSHOUMX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_SF_TUOSHOUMXesDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_SF_TUOSHOUMXDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_SF_TUOSHOUMX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_SF_TUOSHOUMXesDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_SF_TUOSHOUMXesDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_SF_TUOSHOUMX(YS_SF_TUOSHOUMX YS_SF_TUOSHOUMX, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_SF_TUOSHOUMX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_SF_TUOSHOUMX.I_TUOSHOUPZH;
            storedParams[1].Value = YS_SF_TUOSHOUMX.I_HEZHANGBH;
            storedParams[2].Value = YS_SF_TUOSHOUMX.S_ZHANDIANBH;
            storedParams[3].Value = YS_SF_TUOSHOUMX.I_FEIYONGBH;
            storedParams[4].Value = YS_SF_TUOSHOUMX.S_GUANLIKBH;
            storedParams[5].Value = YS_SF_TUOSHOUMX.I_Y;
            storedParams[6].Value = YS_SF_TUOSHOUMX.I_M;
            storedParams[7].Value = YS_SF_TUOSHOUMX.S_YONGHUM;
            storedParams[8].Value = YS_SF_TUOSHOUMX.N_JINE;
            storedParams[9].Value = YS_SF_TUOSHOUMX.S_KAIHUHM;
            storedParams[10].Value = YS_SF_TUOSHOUMX.S_KAIHUZH;
            storedParams[11].Value = YS_SF_TUOSHOUMX.S_KAIHUYH;
            storedParams[12].Value = YS_SF_TUOSHOUMX.I_TUOSHOULX;
            storedParams[13].Value = YS_SF_TUOSHOUMX.I_TICHUBZ;
            storedParams[14].Value = YS_SF_TUOSHOUMX.I_PRINT;
            storedParams[15].Value = YS_SF_TUOSHOUMX.I_JLZT;
            storedParams[16].Value = YS_SF_TUOSHOUMX.S_BEIYONG1;
            storedParams[17].Value = YS_SF_TUOSHOUMX.S_BEIYONG2;
            storedParams[18].Value = YS_SF_TUOSHOUMX.S_CAOZUOR;
            storedParams[19].Value = YS_SF_TUOSHOUMX.D_CAOZUOSJ;
            storedParams[20].Value = YS_SF_TUOSHOUMX.S_YONGHUH;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_SF_TUOSHOUMX.ID = Convert.ToInt32(storedParams[21].Value);
            return result;
        }

        private bool UpdateYS_SF_TUOSHOUMX(YS_SF_TUOSHOUMX YS_SF_TUOSHOUMX, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_SF_TUOSHOUMX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_SF_TUOSHOUMX.I_TUOSHOUPZH;
            storedParams[1].Value = YS_SF_TUOSHOUMX.I_HEZHANGBH;
            storedParams[2].Value = YS_SF_TUOSHOUMX.S_ZHANDIANBH;
            storedParams[3].Value = YS_SF_TUOSHOUMX.I_FEIYONGBH;
            storedParams[4].Value = YS_SF_TUOSHOUMX.S_GUANLIKBH;
            storedParams[5].Value = YS_SF_TUOSHOUMX.I_Y;
            storedParams[6].Value = YS_SF_TUOSHOUMX.I_M;
            storedParams[7].Value = YS_SF_TUOSHOUMX.S_YONGHUM;
            storedParams[8].Value = YS_SF_TUOSHOUMX.N_JINE;
            storedParams[9].Value = YS_SF_TUOSHOUMX.S_KAIHUHM;
            storedParams[10].Value = YS_SF_TUOSHOUMX.S_KAIHUZH;
            storedParams[11].Value = YS_SF_TUOSHOUMX.S_KAIHUYH;
            storedParams[12].Value = YS_SF_TUOSHOUMX.I_TUOSHOULX;
            storedParams[13].Value = YS_SF_TUOSHOUMX.I_TICHUBZ;
            storedParams[14].Value = YS_SF_TUOSHOUMX.I_PRINT;
            storedParams[15].Value = YS_SF_TUOSHOUMX.I_JLZT;
            storedParams[16].Value = YS_SF_TUOSHOUMX.S_BEIYONG1;
            storedParams[17].Value = YS_SF_TUOSHOUMX.S_BEIYONG2;
            storedParams[18].Value = YS_SF_TUOSHOUMX.S_CAOZUOR;
            storedParams[19].Value = YS_SF_TUOSHOUMX.D_CAOZUOSJ;
            storedParams[20].Value = YS_SF_TUOSHOUMX.S_YONGHUH;
            storedParams[21].Value = YS_SF_TUOSHOUMX.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_SF_TUOSHOUMX PopulateYS_SF_TUOSHOUMX(IDataReader dr)
        {
            var YS_SF_TUOSHOUMX = new YS_SF_TUOSHOUMX();
            YS_SF_TUOSHOUMX.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_SF_TUOSHOUMX.I_TUOSHOUPZH = dr["I_TUOSHOUPZH"] == DBNull.Value ? null : (decimal?) dr["I_TUOSHOUPZH"];
            YS_SF_TUOSHOUMX.I_HEZHANGBH = dr["I_HEZHANGBH"] == DBNull.Value ? null : (decimal?) dr["I_HEZHANGBH"];
            YS_SF_TUOSHOUMX.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? null : (string) dr["S_ZHANDIANBH"];
            YS_SF_TUOSHOUMX.I_FEIYONGBH = dr["I_FEIYONGBH"] == DBNull.Value ? null : (decimal?) dr["I_FEIYONGBH"];
            YS_SF_TUOSHOUMX.S_GUANLIKBH = dr["S_GUANLIKBH"] == DBNull.Value ? null : (string) dr["S_GUANLIKBH"];
            YS_SF_TUOSHOUMX.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?) dr["I_Y"];
            YS_SF_TUOSHOUMX.I_M = dr["I_M"] == DBNull.Value ? null : (decimal?) dr["I_M"];
            YS_SF_TUOSHOUMX.S_YONGHUM = dr["S_YONGHUM"] == DBNull.Value ? null : (string) dr["S_YONGHUM"];
            YS_SF_TUOSHOUMX.N_JINE = dr["N_JINE"] == DBNull.Value ? null : (double?) dr["N_JINE"];
            YS_SF_TUOSHOUMX.S_KAIHUHM = dr["S_KAIHUHM"] == DBNull.Value ? null : (string) dr["S_KAIHUHM"];
            YS_SF_TUOSHOUMX.S_KAIHUZH = dr["S_KAIHUZH"] == DBNull.Value ? null : (string) dr["S_KAIHUZH"];
            YS_SF_TUOSHOUMX.S_KAIHUYH = dr["S_KAIHUYH"] == DBNull.Value ? null : (string) dr["S_KAIHUYH"];
            YS_SF_TUOSHOUMX.I_TUOSHOULX = dr["I_TUOSHOULX"] == DBNull.Value ? null : (decimal?) dr["I_TUOSHOULX"];
            YS_SF_TUOSHOUMX.I_TICHUBZ = dr["I_TICHUBZ"] == DBNull.Value ? null : (decimal?) dr["I_TICHUBZ"];
            YS_SF_TUOSHOUMX.I_PRINT = dr["I_PRINT"] == DBNull.Value ? null : (decimal?) dr["I_PRINT"];
            YS_SF_TUOSHOUMX.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            YS_SF_TUOSHOUMX.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string) dr["S_BEIYONG1"];
            YS_SF_TUOSHOUMX.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string) dr["S_BEIYONG2"];
            YS_SF_TUOSHOUMX.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            YS_SF_TUOSHOUMX.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUOSJ"];
            YS_SF_TUOSHOUMX.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string) dr["S_YONGHUH"];
            return YS_SF_TUOSHOUMX;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion